/*
 * @Author: DUST
 * @Date: 2023-05-28 11:22:16
 * @LastEditors: DUST
 * @LastEditTime: 2023-11-27 14:16:33
 * @FilePath: \business-card-system\server\app\validator\LoginValidator.ts
 * @Description: 
 * undefined
 */
import { Rules } from "async-validator";
/**
 * @description: 登录参数
 */
export interface LoginParams {
  username: string;
  password: string;
}
export enum actionPower {
  "全部权限",
  "增",
  "改",
  "软删",
  "真删",
}
class LoginValidator { 
  /**
   * @description: d登录校验规则
   */  
  private _loginRules:Rules = {
    username: [
      {
        type: "string",
        required: true,
        message: "用户名不能为空"
      }
    ],
    password: [
      {
        type: "string",
        required: true,
        message: "密码不能为空"
      }
    ],

  }
  public get loginRules(): Rules {
    return this._loginRules;
  }
  private _editRules: Rules = {
    pwd: [
      {
        type: "string",
        required: true,
        message: "原密码不能为空"
      }
    ],
    pwd1: [
      {
        type: "string",
        required: true,
        message: "新密码不能为空"
      }
    ],
    pwd2: [
      {
        type: "string",
        required: true,
        message: "重复新密码不能为空"
      }
    ]
  }
  public get editRules() : Rules {
    return this._editRules;
  }
}

export default new LoginValidator;